{% block sw_product_deliverability_downloadable_form %}
<sw-container class="product-deliverability-downloadable-form">

    <sw-inherit-wrapper
        v-model:value="product.isCloseout"
        :has-parent="!!parentProduct.id"
        :inherited-value="parentProduct.isCloseout"
        @update:value="onSwitchInput"
    >
        <template #content="props">

            <mt-switch
                class="product-deliverability-downloadable-form__manage-stock-switch"
                name="sw-field--product-is-closeout"
                :error="productIsCloseoutError"
                :is-inheritance-field="props.isInheritField"
                :is-inherited="props.isInherited"
                :inherited-value="parentProduct.isCloseout"
                :label="$tc('sw-product.detailBase.manageStockLabel')"
                :help-text="$tc('sw-product.detailBase.manageStockTooltip')"
                :disabled="props.isInherited || disabled"
                :model-value="props.currentValue"
                @update:model-value="props.updateCurrentValue"
                @inheritance-restore="props.restoreInheritance"
                @inheritance-remove="props.removeInheritance"
            />

        </template>
    </sw-inherit-wrapper>

    <sw-container
        v-show="showStockSetting"
        columns="1fr 1fr"
        gap="0px 30px"
    >

        <mt-number-field
            v-model="product.stock"
            name="sw-field--product-stock"
            number-type="int"
            :disabled="disabled"
            :label="$tc('sw-product.settingsForm.labelStock')"
            :placeholder="$tc('sw-product.settingsForm.placeholderStock')"
            :error="productStockError"
        />

        <mt-number-field
            v-model="product.availableStock"
            name="sw-field--product-available-stock"
            number-type="int"
            :disabled="true"
            :label="$tc('sw-product.settingsForm.labelAvailableStock')"
        />

    </sw-container>

    <sw-inherit-wrapper
        v-if="showModeSetting"
        v-model:value="product.deliveryTimeId"
        :inherited-value="parentProduct.deliveryTimeId"
        :has-parent="!!parentProduct.id"
        :label="$tc('sw-product.settingsForm.labelDeliveryTime')"
    >
        <template #content="{ currentValue, updateCurrentValue, isInherited }">

            <sw-entity-single-select
                id="deliveryTimeId"
                :key="isInherited"
                :value="currentValue"
                entity="delivery_time"
                :disabled="isInherited || disabled"
                class="product-deliverability-downloadable-form__delivery-time"
                :error="productDeliveryTimeIdError"
                :placeholder="$tc('sw-product.settingsForm.placeholderDeliveryTime')"
                show-clearable-button
                @update:value="updateCurrentValue"
            />
        </template>
    </sw-inherit-wrapper>
</sw-container>
{% endblock %}
